# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import readingAndWritingExcelConstants

class ReadingAndWritingExcelSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(ReadingAndWritingExcelSubDirectiveTree, self).__init__(parent)
        self.createReadingAndWritingExcelTreeNode()

    def createReadingAndWritingExcelTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "readingAndWritingExcel"
        self.setText(0,"读写Excel操作")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.gettingRowCountOfExcelDirective, "读取Excel总行数")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.copyingExcelDirective, "拷贝Excel内容")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.pastingExcelDirective, "粘贴Excel内容")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.gettingTheFirstAvailableRowDirective, "获取第一个可用行")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.gettingTheFirstAvailableRowInColumnDirective, "获取列上第一个可用行")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.gettingTheFirstAvailableColumnDirective, "获取第一个可用列")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.gettingTheFirstAvailableColumnInRowDirective,
                            "获取行上第一个可用列")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.gettingTheLastColumnDirective,
                            "获取最后一列")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.clearExcelDirective,
                            "清空Excel内容")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.deletingExcelRowDirecive,
                            "删除行")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.deletingTheDuplicatedExcelRowDirecive,
                            "删除重复行")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.deletingAllExcelRowsDirective,
                            "删除所有行")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.deletingExcelColumnDirective,
                            "删除列")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.insertingBlankExcelRowDirective,
                            "插入空行")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.insertingBlankExcelColumnDirective,
                            "插入空列")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.selectingExcelAreaDirecive,
                            "选中区域")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.gettingSelectedExcelAreaDirective,
                            "获取选中区域")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self,
                            readingAndWritingExcelConstants.ReadingAndWritingExcelConstants.hidingExcelRowOrColumnDirective,
                            "设置行列隐藏")



